package collection;

import java.util.ArrayList;
import java.util.Collection;

public class TestA {
    public static void main(String[] args) {
        Collection<String> objects = new ArrayList<>();
        objects.add("a");
        objects.add("b");
//        objects.add("c");
        Collection<String> ob = new ArrayList<>();

        ob.add("b");
        ob.add("a");
//        ob.add("e");
//        boolean retainAll = objects.retainAll(ob);
//        System.out.println(objects);
//        equals()方法比较集合是否相等，比较时跟顺序有关，它是一个元素一个元素比较的，所以结果为false
        System.out.println(objects.equals(ob));
        System.out.println(objects.containsAll(ob));


    }
}
